<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>SDCC Compiler User Guide: ANSI-Compliance.</TITLE>
 <LINK HREF="SDCCUdoc-24.html" REL=next>
 <LINK HREF="SDCCUdoc-22.html" REL=previous>
 <LINK HREF="SDCCUdoc.html#toc23" REL=contents>
</HEAD>
<BODY>
<A HREF="SDCCUdoc-24.html">Next</A>
<A HREF="SDCCUdoc-22.html">Previous</A>
<A HREF="SDCCUdoc.html#toc23">Contents</A>
<HR>
<H2><A NAME="ANSI_Compliance"></A> <A NAME="s23">23. ANSI-Compliance.</A> </H2>

<P>Deviations from the compliancy.
<P>
<OL>
<LI>functions are not always reentrant.</LI>
<LI>structures cannot be assigned values directly, cannot be passed as function
parameters or assigned to each other and cannot be a return value from a function.
<PRE>
eg
  
</PRE>
</LI>
</OL>
<P>
<PRE>
struct s { ... }; 
struct s s1, s2; 
foo() 
{ 
... 
s1 =
 s2 ; /* is invalid in SDCC although allowed in ANSI */ 
... 
}struct s foo1 (struct s parms) /* is invalid in SDCC although allowed in
 ANSI */ 
{ 
struct s rets; 
... 
return rets;/* is invalid in SDCC although
 allowed in ANSI */ 
}
 
</PRE>
<P>
<OL>
<LI>'long long' (64 bit integers) not supported.</LI>
<LI>'double' precision floating point not supported.</LI>
<LI>integral promotions are suppressed. What does this mean ? The compiler
will not implicitly promote an integer expression to a higher order integer,
exception is an assignment or parameter passing. </LI>
<LI>No support for setjmp and longjmp (for now).</LI>
<LI>Old K&amp;R style function declarations are NOT allowed.</LI>
</OL>
<P>
<PRE>
foo( i,j) /* this old style of function declarations */ 
int i,j; /* are
 valid in ANSI .. not valid in SDCC */ 
{ 
... 
}
 
</PRE>
<P>
<OL>
<LI>functions declared as pointers must be dereferenced during the call.
<PRE>
int (*foo)();
  
</PRE>
</LI>
</OL>
<P>
<PRE>
   ... 
   /* has to be called like this */ 
   (*foo)();/* ansi standard
 allows calls to be made like 'foo()' */
 
</PRE>
<HR>
<A HREF="SDCCUdoc-24.html">Next</A>
<A HREF="SDCCUdoc-22.html">Previous</A>
<A HREF="SDCCUdoc.html#toc23">Contents</A>
</BODY>
</HTML>
